<%--
  Created by IntelliJ IDEA.
  User: Wenxin
  Date: 2017/3/13
  Time: 19:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../base/commons.jsp" %>
<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>用户列表</title>
    <%@include file="../base/head.jsp" %>
    <script type="text/javascript" language="JavaScript">
        function goToUrl(url) {
            window.location.href = url;
        }
    </script>
    <style type="text/css">
        h2 {
            margin-top: 60px;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
<div class="container">
    <h2>用户列表</h2>
    <div class="row-fluid">
        <div class="span12">
            <table class="table table-hover table-bordered">
                <thead>
                <tr>
                    <th>
                        编号
                    </th>
                    <th>
                        用户名
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${userList}" begin="0" step="1" var="user" varStatus="index">
                    <tr>
                        <td>
                            <c:out value="${index.index}"/>
                        </td>
                        <td>
                                ${user.username}
                        </td>
                        <td>
                            <button type="button" class="btn btn-primary" onclick="goToUrl('${baseUrl}user/update?id=${user.id}')">修改</button>
                            <button type="button" class="btn btn-danger" onclick="goToUrl('${baseUrl}user/delete?id=${user.id}')">删除</button>
                        </td>
                    </tr>
                </c:forEach>

                </tbody>
            </table>
        </div>
    </div>
</div>


</body>
</html>
